home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
MAC
/
THINKC
/
5
/
CHASSIS_
/
MAINGETP.C
< prev
next >
Wrap
Text File
|
1992-05-14
|
2KB
|
51 lines
/************************************************************************************/
/* MainGetProc */
/************************************************************************************/
#include "MyHeaders.h"
int MainGetProc ()
{
int MGRetCode = 0;
Rect mainRect;
int rectHeight, rectWidth;
int newH, newV;
int itemHit; /* return from modal dialog */
windSub = 0; /* point to main info */
if (useColor)
windTbl[windSub].windPtr = /* get the color template */
GetNewCWindow (128, &windTbl[windSub].windRec, (WindowPtr) -1);
else
windTbl[windSub].windPtr = /* get the template */
GetNewWindow (128, &windTbl[windSub].windRec, (WindowPtr) -1);
windTbl[windSub].windRec.refCon = ProcMain; /* save window type */
mainRect = (*windTbl[windSub].windPtr).portRect; /* position wdow on desktop */
rectHeight = mainRect.bottom - mainRect.top;
rectWidth = mainRect.right - mainRect.left;
newH = (screenBits.bounds.right - rectWidth) * .50; /* centered horizonally */
if (newH < 10) /* (not less than 10) */
newH = 10;
newV = ((screenBits.bounds.bottom /* vertical position */
- rectHeight - 20) * .50) + 20; /* one-half down */
if (newV < 40) /* (not less than 40) */
newV = 40;
MoveWindow (windTbl[windSub].windPtr, newH, newV, TRUE); /* move into posit. */
SetPort (windTbl[windSub].windPtr); /* set as the grafPort */
TextFont(geneva); /* choose the font... */
TextFace(NIL); /* ... style, and.. */
TextSize(10); /* ... size */
ShowWindow (windTbl[windSub].windPtr);
InvalRect (&(*windTbl[windSub].windPtr).portRect); /* indicate need for update */
return MGRetCode;
}